import autoit
from selenium import webdriver

import time

from selenium.webdriver.common.by import By
# 1. 初始化浏览器，打开目标页面
driver = webdriver.Edge()
driver.get("https://www.baidu.com/")
driver.maximize_window()  # 确保窗口在前台，避免pyautogui操作失效
time.sleep(2)
driver.find_element(By.XPATH,"//div[@class='right-tools-wrapper']//div[3]//div[1]//div[1]//*[name()='svg']").click()


time.sleep(2)
#
autoit.win_wait_active("打开",5)
autoit.control_set_text("打开","Edit1",r"E:\Desktop\1111.jpg")
autoit.control_click("打开","Button2")


time.sleep(10)



driver.close()  #关闭窗口的
driver.quit() #关闭浏览器的